package com.example.cdctestsystem.service.impl;

import com.example.cdctestsystem.mapper.UserInfoMapper;
import com.example.cdctestsystem.pojo.UserInfo;
import com.example.cdctestsystem.service.UserInfoService;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service("userInfoService")
@Transactional(rollbackFor = Exception.class)
public class UserInfoServiceImpl implements UserInfoService {
    @Resource
    private UserInfoMapper userInfoMapper;

    @Override
    public void insert(UserInfo object) {
        userInfoMapper.insert(object);
    }

    @Override
    public void delete(Integer id) {

    }

    @Override
    public void delete(String ids) {

    }

    @Override
    public void update(UserInfo object) {
        userInfoMapper.updateUserPass(object);
    }

    @Override
    public UserInfo findById(Integer id) {
        return null;
    }

    @Override
    public List<UserInfo> findAll() {
        return null;
    }

    @Override
    public PageInfo<UserInfo> findPage(int pageSize) {
        return null;
    }


    @Override
    public UserInfo login(UserInfo userInfo) {

        return userInfoMapper.login(userInfo);
    }

    @Override
    public UserInfo isEmail(UserInfo userInfo) {
        return userInfoMapper.isEmail(userInfo);
    }

    @Override
    public UserInfo selectUserByEmail(String email) {
        return userInfoMapper.selectUserByEmail(email);
    }
}
